// REM font-sizing mixin
// 
// Borrowed and modified, based on http://hugogiraudel.com/2013/03/18/ultimate-rem-mixin/
        
$remsize: 16 * (parseInt($html-font-size) / 100);

@mixin rem($property, $values) {
    $px : ();
    $rem: ();
    
    @each $value in $values {
        
        @if $value == 0 or $value == auto {
            $px : append($px , $value);
            $rem: append($rem, $value);
        }
        
        @else {
            $unit: unit($value);
            $val: parseInt($value);
            
            @if $unit == "px" {
                $px : append($px,  $value);
                $rem: append($rem, ($val / $remsize + rem));
            }
        
            @if $unit == "rem" or unitless($value) {
                $px : append($px,  ($val * $remsize + px));
                $rem: append($rem, $value);
            }
        
        }
    }
        
    @if $px == $rem {
        #{$property}: $px;
    } @else {
        #{$property}: $px;
        #{$property}: $rem;
    }
}
